//
//  NSString+YODUtil.h
//  YOD
//
//  Created by peter on 4/24/15.
//  Copyright (c) 2015 siloon. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface NSString(YODUtil)

- (BOOL)contains:(NSString *)str caseSensitive:(BOOL)caseSensitive;
- (NSString*)trim;
- (NSDate*)convertToNSDate:(NSString *)format;

//validation

- (BOOL)checkEmail;
- (BOOL)checkEmpty;
- (BOOL)checkAlphabeticAllowWhitespace:(BOOL)allowWhitespace;
- (BOOL)checkWithRange:(NSRange)_range;
- (BOOL)checkShortURL;
- (BOOL)checkURL;
- (BOOL)checkAlphanumeric;
// 检查是否全部为数字，主要用于验证手机号码、验证码等。
- (BOOL)checkNumeric;

//根据长度获取字符串，如果字符串长度超过指定长度，则以...替换
- (NSString *)getStrippedStringWithLength:(NSUInteger)length;

// 16进制颜色转换
- (UIColor *)getColor;

//将影片时长转换为字符串，格式为00:00:00
+ (NSString *)convertSecondsToTimeString:(CGFloat)seconds;


@end
